import { defHttp } from "@/utils/http";

// ERP 对象组 VO
export interface ObjGrpVO {
	id: number; // 对象组ID
	name: string; // 对象组名称
	grpId: number; // 分组
	hspId: number; // 医院ID
	sqNumb: number; // 序号
}

// ERP 对象组 API
export const ObjGrpApi = {
	// 查询对象组分页
	getObjGrpPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/obj-grp/page`, params });
	},

	// 查询对象组详情
	getObjGrp: async (id: number) => {
		return await defHttp.get({ url: `/whs/obj-grp/get?id=` + id });
	},

	// 新增对象组
	createObjGrp: async (data: ObjGrpVO) => {
		return await defHttp.post({ url: `/whs/obj-grp/create`, data });
	},

	// 修改对象组
	updateObjGrp: async (data: ObjGrpVO) => {
		return await defHttp.put({ url: `/whs/obj-grp/update`, data });
	},

	// 删除对象组
	deleteObjGrp: async (id: number) => {
		return await defHttp.delete({ url: `/whs/obj-grp/delete?id=` + id });
	},

	// 导出对象组 Excel
	exportObjGrp: async (params: any) => {
		return await defHttp.download({ url: `/whs/obj-grp/export-excel`, params });
	}
};
